# -*- coding: utf-8 -*-

def duree(debut, fin):
	a, b = debut
	c, d = fin
	debm = a*60 + b
	finm = c*60 + d
	delta = finm-debm
	if delta<0: 
		delta = 24*60+delta
	return (delta/60, delta%60)

print duree((6, 0), (5, 15))
